﻿/* Copyright 2012 Sannel Software, L.L.C.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at

 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
using System;
using System.Collections.Generic;
using System.Text;

namespace Sannel.Calculate.Nodes
{
	/// <summary>
	/// The base class for all number nodes
	/// </summary>
	public abstract class NumberNode : BaseNode
	{
		/// <summary>
		/// Always returns NodeType.Number;
		/// </summary>
		public override NodeType NodeType
		{
			get { return Nodes.NodeType.Number; }
		}

		/// <summary>
		/// In derived classes this returns the number type 
		/// </summary>
		public abstract TypeCode NumberType
		{
			get;
		}

		/// <summary>
		/// Returns the numerical value of this object
		/// </summary>
		public abstract Object ObjectValue
		{
			get;
		}

		public abstract Byte ToByte();
		
		public abstract Int16 ToInt16();
		
		public abstract Int32 ToInt32();
		
		public abstract Int64 ToInt64();

		public abstract Single ToSingle();

		public abstract Double ToDouble();

		public abstract Decimal ToDecimal();
	}
}
